package com.tarena.lbs.business.rpc;

import com.tarena.lbs.business.api.BusinessApi;
import com.tarena.lbs.business.api.pojo.BusinessDto;
import com.tarena.lbs.business.dao.repository.BusinessRepository;
import com.tarena.lbs.business.pojo.po.BusinessPO;
import com.tarena.lbs.business.pojo.vo.BusinessVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;

import javax.annotation.Resource;

@DubboService
@Slf4j
public class BusinessApiImpl implements BusinessApi {
    @Resource
    private BusinessRepository businessRepository;
    @Override
    public BusinessDto getBusinessById(Integer businessId) {
        log.info("查询门店{}的详细信息",businessId);
        BusinessDto  businessDto = new BusinessDto();
        BusinessPO businessPO = businessRepository.busiStoreDetail(businessId);
        BeanUtils.copyProperties(businessPO,businessDto);
        return businessDto;
    }




}
